<%@ page language="java" pageEncoding="utf-8"%>
<%@page import="com.farm.web.constant.FarmConstant"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="/view/conf/farmtag.tld" prefix="PF"%>
<div style="text-align: center;">
	<h3>模板：${template.name }</h3>
	<button onclick="runTemplate()" type="button"
		class="btn btn-success btn-lg">生成文件</button>
	<c:if test="${pagemodel=='debug' }">
		<button
			onclick="window.open('temveiw/index.do?templateid=${template.id}')"
			type="button" class="btn btn-info btn-sm">编辑模板</button>
	</c:if>
</div>
<script type="text/javascript">
	function runTemplate() {
		$.post('prorun/doRunTemplate.do', {
			'activeid' : '${active.id}',
			'nodeid' : '${node.id}'
		}, function(flag) {
			if (flag.STATE == 0) {
				loadAndSubmitForm("模板已经生成，是否继续后续任务?");
			} else {
				alert(flag.MESSAGE);
			}
		}, 'json');
	}
</script>